package com.ctg.itrdc.sysmgr.portal.control;

import javax.annotation.Resource;

import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ctg.itrdc.sysmgr.portal.api.dto.AttrSpecDTO;
import com.ctg.itrdc.sysmgr.portal.api.dto.AttrValueDTO;
import com.ctg.itrdc.sysmgr.portal.api.service.IAttrValueService;
import com.ctg.itrdc.sysmgr.portal.common.entity.CommonResult;
import com.ctg.itrdc.sysmgr.portal.data.entity.AttrValue;

@Controller
@RequestMapping("/attr_value")
public class AttrValueController extends SysmgrCURDController<Long, AttrValueDTO> {

	@Resource
	private IAttrValueService sysAttrValueService;

	/**
	 * @api {get} /attr_value/dict 字典表查询
	 * @apiGroup attr_value
	 * @apiName dict
	 * @apiParam {String} attrNbr 业务对象属性规格名称 
	 * @apiVersion 0.0.1
	 */
	@RequestMapping("/dict")
	@ResponseBody
	public CommonResult dict(AttrSpecDTO attrSpec) {
		return new CommonResult(HttpStatus.OK.toString(), "查询成功",
				sysAttrValueService.selectByAttrSpec(attrSpec));
	}

}
